<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>流程列表</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100vh;
            background-color: #f4f4f4;
        }

        .container {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            grid-gap: 10px;
            width: 80%;
            background: white;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        .item {
            display: flex;
            justify-content: center;
            align-items: center;
            background: #e0e0e0;
            border-radius: 5px;
            padding: 20px;
            cursor: pointer;
            transition: background-color 0.3s;
        }

        .item:hover {
            background: #d0d0d0;
        }

        .fa {
            font-size: 18px;
        }
    </style>
    <script src="jquery-1.11.0.min.js" crossorigin="anonymous"></script>
</head>
<body>
<div class="container">

</div>
<script>


    try {
        let listInfo = getWfListInfo();
        console.log("listInfo=",listInfo);
        let datas = accessToken();
        console.log("datas=",datas);
        listInfo.forEach(function (json) {
            let linkurl = json.linkurl + "?ssotoken=" + datas.ssotoken + "&ticket=" + datas.ticket;
            let item = document.createElement("a");
            item.setAttribute("href", linkurl);
            item.setAttribute("class", "item");
            item.setAttribute("target", "_blank");
            item.innerHTML = `<i class="fa fa-heart">${json.title}</i>`;
            document.querySelector(".container").appendChild(item);
        });
    } catch (e) {
        console.log("转化json数组异常");
    }


    function accessToken() {
        var datas = {};
        $.ajax({
            async: false,
            url: '/interface/cyjt/mchr/accessToken.jsp',
            type: "GET",
            dataType: "json",
            success: function (data) {
                datas = data;
            }, error: function (e) {
            }
        });
        return datas;
    }

    function getWfListInfo() {
        var datas = [];
        $.ajax({
            async: false,
            url: '/interface/cyjt/mchr/getWfListInfo_Ajax.jsp',
            type: "GET",
            dataType: "json",
            success: function (data) {
                datas = data.datas;
            }, error: function (e) {
            }
        });
        return datas;
    }

</script>
</body>
</html>
